import antfu from "@antfu/eslint-config"

// 更多自定义配置可查阅仓库：https://github.com/antfu/eslint-config
export default antfu(
  {
    // 使用外部格式化程序格式化 css、html、markdown 等文件
    formatters: true,
    // 启用样式规则
    stylistic: {
      // 缩进级别
      indent: 2,
      // 引号风格 'single' | 'double'
      quotes: "double",
      // 是否启用分号
      semi: false
    },
    // 忽略文件
    ignores: [
      "API Generator Platform.md",
      "api-generator-platform/**",
      "*.sql",
      "**/*.class",
      "**/target/**",
      "**/node_modules/**",
      "**/dist/**"
    ]
  },
  {
    // 对所有文件都生效的规则
    rules: {
      // vue - 禁用所有Vue相关检查
      "vue/block-order": "off",
      "vue/attributes-order": "off",
      "vue/no-side-effects-in-computed-properties": "off",
      "vue/no-unused-vars": "off",
      "vue/valid-template-root": "off",
      "vue/no-multiple-template-root": "off",
      // ts - 忽略TypeScript类型检查
      "ts/no-use-before-define": "off",
      "@typescript-eslint/no-explicit-any": "off",
      "@typescript-eslint/no-unsafe-assignment": "off",
      "@typescript-eslint/no-unsafe-member-access": "off",
      "@typescript-eslint/no-unsafe-call": "off",
      "@typescript-eslint/no-unsafe-return": "off",
      "@typescript-eslint/no-unsafe-argument": "off",
      "@typescript-eslint/restrict-template-expressions": "off",
      "@typescript-eslint/restrict-plus-operands": "off",
      "@typescript-eslint/no-floating-promises": "off",
      "@typescript-eslint/await-thenable": "off",
      "@typescript-eslint/require-await": "off",
      "@typescript-eslint/no-misused-promises": "off",
      "@typescript-eslint/prefer-nullish-coalescing": "off",
      "@typescript-eslint/prefer-optional-chain": "off",
      "@typescript-eslint/strict-boolean-expressions": "off",
      "@typescript-eslint/no-unnecessary-condition": "off",
      // node
      "node/prefer-global/process": "off",
      // style
      "style/comma-dangle": ["error", "never"],
      "style/brace-style": ["error", "1tbs"],
      // regexp
      "regexp/no-unused-capturing-group": "off",
      // other
      "no-console": "off",
      "no-debugger": "off",
      "symbol-description": "off",
      "antfu/if-newline": "off",
      "unicorn/no-instanceof-builtins": "off",
      // 忽略更多规则
      "no-cond-assign": "off",
      "no-unused-vars": "off",
      "no-undef": "off",
      "jsdoc/check-param-names": "off",
      "jsdoc/require-param": "off",
      "jsdoc/require-returns": "off",
      // 禁用所有可能的错误检查
      "prefer-const": "off",
      "no-var": "off",
      "no-unreachable": "off"
    }
  }
)
